package apiTest;

import cn.com.elite.EliteBean;
import cn.com.kh.TxConfig;
import net.sf.json.JSONObject;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.jdbc.core.JdbcTemplate;

/* 4.1操作员统一登录授权接口 */
public class API_CustDealDev {
    private static final Log log = LogFactory.getLog(API_CustDealDev.class);

    public static void main(String[] args) throws Exception {

        EliteBean eliteBean = new EliteBean();
        JSONObject outData = JSONObject.fromObject("{\"code\":1,\"message\":\"操作成功\"}");

        // 获取数据源
        JdbcTemplate jt = new JdbcTemplate(TxConfig.getDruidDataSource());


        // 获取调用数据
        String optype = "HIS";
        log.info("同步(补录)单个或全量客户信息 请求参数：" + optype);

        String opJson = "{\"token\":\"5b7ba6ce3c5f4c2f97ec6b195cb30d41-652\",\"hsNo\":\"11049140\"}";
        opJson = "{\"createBeginTime\":\"2022-01-04 10:35:49\",\"createEndTime\":\"2024-08-04 10:35:49\"}\n";
        log.info("同步(补录)单个或全量客户信息 请求Body：" + opJson);

        /*try {
            if (optype.equals("CUST")) {
                outData = doCust_One(jt, opJson);

            } else if (optype.equals("HIS")) {
                outData = doCust_History(jt, opJson);

            } else {
                outData.put("code", -1);
                outData.put("message", "不支持的操作类型optype:" + optype);
            }

        } catch (Exception e) {
            outData.put("code", -2);
            outData.put("message", "HTTP请求调用错误(" + e.getMessage() + "),请稍后再试!");
            log.error(outData, e);

        }*/
        log.debug("同步(补录)单个或全量客户信息 返回:" + outData.toString());

    }
}